<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>承运商管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">
		var validateForm;
		var $table; // 父页面table表格id
		var $topIndex;//弹出窗口的 index
		function doSubmit(table, index){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $table = table;
			  $topIndex = index;
			  jp.loading();
			  $("#inputForm").submit();
			  return true;
		  }

		  return false;
		}

		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					jp.post("${ctx}/tms/resource/save",$('#inputForm').serialize(),function(data){
						if(data.success){
	                    	$table.bootstrapTable('refresh');
	                    	jp.success(data.msg);
	                    	jp.close($topIndex);//关闭dialog

	                    }else{
            	  			jp.error(data.msg);
	                    }
					})
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
	        $('#certificationDate').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#expirationDate').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#insuranceDate').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#cooperationDate').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#registerDate').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#topDate').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
		});
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="resource" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<table class="table table-bordered">
		   <tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right"><font color="red">*</font>公司名称：</label></td>
					<td class="width-35">
						<form:input path="name" htmlEscape="false"    class="form-control required"/>
					</td>
					<td class="width-15 active"><label class="pull-right">联系人：</label></td>
					<td class="width-35">
						<form:input path="contacts" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">电话：</label></td>
					<td class="width-35">
						<form:input path="companyPhone" htmlEscape="false"    class="form-control  isTel"/>
					</td>
					<td class="width-15 active"><label class="pull-right">手机：</label></td>
					<td class="width-35">
						<form:input path="phone" htmlEscape="false"    class="form-control  isTel"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">所属园区：</label></td>
					<td class="width-35">
						<form:input path="park" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">公司地址：</label></td>
					<td class="width-35">
						<form:input path="companyAddress" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">认证类型：</label></td>
					<td class="width-35">
						<sys:checkbox id="authenticationType" name="authenticationType" items="${fns:getDictList('authentication_type')}" values="${resource.authenticationType}" cssClass="i-checks "/>
					</td>
					<td class="width-15 active"><label class="pull-right">认证日期：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='certificationDate'>
			                    <input type='text'  name="certificationDate" class="form-control"  value="<fmt:formatDate value="${resource.certificationDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">认证到期日期：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='expirationDate'>
			                    <input type='text'  name="expirationDate" class="form-control"  value="<fmt:formatDate value="${resource.expirationDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
					<td class="width-15 active"><label class="pull-right">保险到期日期：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='insuranceDate'>
			                    <input type='text'  name="insuranceDate" class="form-control"  value="<fmt:formatDate value="${resource.insuranceDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">合同类型：</label></td>
					<td class="width-35">
						<form:radiobuttons path="cooperationType" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks "/>
					</td>
					<td class="width-15 active"><label class="pull-right">合同到期日期：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='cooperationDate'>
			                    <input type='text'  name="cooperationDate" class="form-control"  value="<fmt:formatDate value="${resource.cooperationDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">软件品牌：</label></td>
					<td class="width-35">
						<form:input path="brand" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">身份证号：</label></td>
					<td class="width-35">
						<form:input path="idCard" htmlEscape="false"    class="form-control  isIdCardNo"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">公司注册时间：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='registerDate'>
			                    <input type='text'  name="registerDate" class="form-control"  value="<fmt:formatDate value="${resource.registerDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
					<td class="width-15 active"><label class="pull-right">公司简介：</label></td>
					<td class="width-35">
						<form:input path="companySummary" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">公司宣传图片：</label></td>
					<td class="width-35">
						<form:hidden id="companyPropaganda" path="companyPropaganda" htmlEscape="false" maxlength="1024" class="form-control"/>
						<sys:ckfinder input="companyPropaganda" type="files" uploadPath="/tms/resource" selectMultiple="true"/>
					</td>
					<td class="width-15 active"><label class="pull-right">营业执照或身份证照片：</label></td>
					<td class="width-35">
						<form:hidden id="businessLicencePhoto" path="businessLicencePhoto" htmlEscape="false" maxlength="1024" class="form-control"/>
						<sys:ckfinder input="businessLicencePhoto" type="files" uploadPath="/tms/resource" selectMultiple="true"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">道路运输许可证照片：</label></td>
					<td class="width-35">
						<form:hidden id="roadTransportPhoto" path="roadTransportPhoto" htmlEscape="false" maxlength="1024" class="form-control"/>
						<sys:ckfinder input="roadTransportPhoto" type="files" uploadPath="/tms/resource" selectMultiple="true"/>
					</td>
					<td class="width-15 active"><label class="pull-right">公司背景墙或门头照片：</label></td>
					<td class="width-35">
						<form:hidden id="wallDoorPhoto" path="wallDoorPhoto" htmlEscape="false" maxlength="1024" class="form-control"/>
						<sys:ckfinder input="wallDoorPhoto" type="files" uploadPath="/tms/resource" selectMultiple="true"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">仓库或办公司照片：</label></td>
					<td class="width-35">
						<form:hidden id="bureauxStorePhoto" path="bureauxStorePhoto" htmlEscape="false" maxlength="1024" class="form-control"/>
						<sys:ckfinder input="bureauxStorePhoto" type="files" uploadPath="/tms/resource" selectMultiple="true"/>
					</td>
					<td class="width-15 active"><label class="pull-right">保险或其它资质照片：</label></td>
					<td class="width-35">
						<form:hidden id="insuranceAptitudePhoto" path="insuranceAptitudePhoto" htmlEscape="false" maxlength="1024" class="form-control"/>
						<sys:ckfinder input="insuranceAptitudePhoto" type="files" uploadPath="/tms/resource" selectMultiple="true"/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">与认证员合影照片：</label></td>
					<td class="width-35">
						<form:hidden id="certifierPhoto" path="certifierPhoto" htmlEscape="false" maxlength="1024" class="form-control"/>
						<sys:ckfinder input="certifierPhoto" type="files" uploadPath="/tms/resource" selectMultiple="true"/>
					</td>
					<td class="width-15 active"><label class="pull-right">是否置顶：</label></td>
					<td class="width-35">
						<form:radiobuttons path="top" items="${fns:getDictList('top')}" itemLabel="label" itemValue="value" htmlEscape="false" class="i-checks "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">置顶到期日期：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='topDate'>
			                    <input type='text'  name="topDate" class="form-control"  value="<fmt:formatDate value="${resource.topDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
					<td class="width-15 active"><label class="pull-right">浏览数：</label></td>
					<td class="width-35">
						<form:input path="skimAmount" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">分享次数：</label></td>
					<td class="width-35">
						<form:input path="sharingTimes" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">备注信息：</label></td>
					<td class="width-35">
						<form:textarea path="remarks" htmlEscape="false" rows="4"    class="form-control "/>
					</td>
				</tr>
		 	</tbody>
		</table>
	</form:form>
</body>
</html>